package springcloud.xiao.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
public class PaymentController {
    private String url="http://cloud-payment-service";
    @Autowired
    private RestTemplate restTemplate;
    @GetMapping(value = "/getDiscovery/{id}")
    public void getDiscovery(@PathVariable("id") Long id){
        String forObject = restTemplate.getForObject(url + "/pay/getDiscovery/"+id, String.class);
        System.out.println(forObject);
    }
}
